package com.nanyang.tms.api.dto.request.waybill;

import java.math.BigDecimal;
import java.util.List;

import javax.validation.Valid;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.Length;

import com.nanyang.common.core.domain.ApiRequest;
import lombok.Data;
@Data
public class CalWeightRequest extends ApiRequest{
   
	private static final long serialVersionUID = 1L;
	@NotEmpty(message = "公司编码不能为空")
	private String companyCode;
	@NotEmpty(message = "目的国家编码不能为空")
	private String countyCode;  //国家编号
	@NotEmpty(message = "州省编码不能为空")
	private String provinceCode;//城市编码
	@NotNull(message = "客户重量不能位空")
	@Digits(integer = 18, fraction=2, message = "weight 整数部分最多18位，小数部分最多2位")
	@DecimalMin(value = "0.01", message = "客户重量必须大于0")
	private BigDecimal weight;  //客户重量
	@NotEmpty(message = "销售产品编码不能为空")
	private String saleProductCode; //产品编码
	@NotEmpty(message = "货物类型编码不能为空")
	private String  cargoTypeCode;//货物类型字典ID
	@NotEmpty(message = "货物类型名称不能为空")
	private String  cargoTypeName;//货物类型字典ID
	@Valid
	@NotNull(message = "材积信息不能为空")
	@Size(min = 1, message = "至少要有一个材积信息")
	private List<CalWeightVolumeRequest> volumes;
	@Override
	public void requestCheck() {
		
	}

}
